import { NestFactory } from '@nestjs/core';
import { GrpcOptions, Transport } from '@nestjs/microservices';
import { AppModule } from './app.module';
import { join } from 'path';

async function bootstrap() {
   const app = await NestFactory.createMicroservice<GrpcOptions>(AppModule, {
      transport: Transport.GRPC,
      options: {
        package: 'book',
        protoPath: join(__dirname, 'hero/hero.proto'),
        url: 'localhost:8888'
      },
   });
   await app.listen();
}
bootstrap();